#!/bin/bash
# 停止并删除旧容器
echo "Stopping and removing old container..."
sudo docker stop dify-tool-container 2>/dev/null
sudo docker rm dify-tool-container 2>/dev/null

# 构建 Docker 镜像
echo "Building Docker image..."
sudo docker build -t dify-tool .

# 运行 Docker 容器
echo "Running Docker container..."
sudo docker run -p 5000:5000 -v $(pwd)/logs:/app/logs --name dify-tool-container dify-tool
# sudo docker run -d -p 5000:5000 -v $(pwd)/logs:/app/logs --name dify-tool-container dify-tool